package process_demo.attributes.id_name;

/**
 * @author haomin
 * @date 2022/04/19 19:35
 **/
public class Main3 {
    static class MyThread extends Thread {
        public MyThread(){
            // 调用父类（Thread）的构造方法
            super("浩民线程");
            // 或者setName
            // setName("浩民set线程");
        }

        @Override
        public void run() {
            System.out.println(this.getName());
        }
    }

    public static void main(String[] args) {
        Thread thread = Thread.currentThread(); // 当前线程
        System.out.println(thread.getName());

        MyThread t1 = new MyThread();
        t1.start();

        MyThread t2 = new MyThread();
        t2.start();

        MyThread t3 = new MyThread();
        t3.start();
    }
}